<?php

/**
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: admincp_pic.inc.php 33234 2016-01-20 20:34:16Z mpage $
 */

if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
	exit('Access Denied');
}

$lang = array_merge($lang, $scriptlang['dzapp_base']);
require_once libfile('function/base', 'plugin/dzapp_base');

if(empty($_GET['ac'])) {

	if(!submitcheck('listsubmit')) {

		showformheader('plugins&operation=config&identifier=dzapp_base&pmod=admincp_pic');
		showtableheader();
		showsubtitle(array('del', 'username', 'name', 'size', 'dateline'));
		$perpage = 20;
		$start = ($page - 1) * $perpage;
		$mpurl = ADMINSCRIPT."?action=plugins&operation=config&identifier=dzapp_base&pmod=admincp_pic";
		$param = array();
		$count = C::t('#dzapp_base#dzapp_base_pic')->count_by_search($param);
		if($count) {
			$query = C::t('#dzapp_base#dzapp_base_pic')->fetch_all_by_search($param, $start, $perpage);
			foreach($query as $value) {
				showtablerow('', array('class="td25"'), array(
					'<input type="checkbox" class="checkbox" name="delete[]" value="'.$value['pic_id'].'" />',
					$value['username'],
					$value['name'],
					$value['size'],
					dgmdate($value['dateline']),
				));
			}
			$multipage = multi($count, $perpage, $page, $mpurl);
		}
		showsubmit('listsubmit', 'submit', 'del', '', $multipage);
		showtablefooter();
		showformfooter();

	} else {

		if(is_array($_GET['delete'])) {
			C::t('#dzapp_base#dzapp_base_pic')->delete($_GET['delete']);
		}

		cpmsg('pic_update_succeed', 'action=plugins&operation=config&identifier=dzapp_base&pmod=admincp_pic', 'succeed');
	}

} 

?>